/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.support.c;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.IDispatcherCallback;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.m;
import com.qihoo.gamecenter.sdk.support.f.b;
import com.qihoo.gamecenter.sdk.support.f.b.a;
import com.qihoo.gamecenter.sdk.support.f.b.b;
import com.qihoo.gamecenter.sdk.support.f.c;
import com.qihoo.gamecenter.sdk.support.f.c.a;
import com.qihoo.gamecenter.sdk.suspend.b.e.f;

public class a {
    private static boolean a = false;
    private static String b = "default";
    private static String c = "pic";
    private static String d = "news";
    private static String e = null;
    private static b.b[] f = null;
    private static String g = null;

    public static void a(Context paramContext, String paramString, boolean paramBoolean,
            IDispatcherCallback paramIDispatcherCallback) {
        com.qihoo.gamecenter.sdk.support.g.a.a("SupportConfig", new Object[] { "doPrefetch, qid=" + paramString });
        if (TextUtils.isEmpty(paramString))
            return;
        new c(paramContext, new d.a(paramIDispatcherCallback, paramContext, paramString, paramBoolean) {
            public void a(int paramInt, String paramString, c.a parama) {
                if ((paramInt == 0) && (parama != null)) {
                    if (this.a != null)
                        this.a.onFinished(parama.a());
                    m.a(this.b, "has_show_message", parama.b());
                    m.a(this.b, "message_min_interval", parama.c());
                    m.a(this.b, "message_max_interval", parama.d());
                    m.a(this.b, "has_show_memory_clear", parama.e());
                    m.a(this.b, "has_show_service", parama.f());
                    m.a(this.b, "has_show_bbs", parama.g());
                    m.a(this.b, "bbs_url", parama.h());
                }
                else if (this.a != null) {
                    this.a.onFinished(null);
                }
                a.a(this.b, this.c, this.d);
            }
        }).execute(new String[] { paramString });
    }

    public static void a(Context paramContext, String paramString, boolean paramBoolean) {
        String str = paramContext.getCacheDir() + "/" + f.a(paramContext.getPackageName());
        c = str + "_pic";
        d = str + "_news";
        a = false;
        new b(paramContext, new d.a(paramContext) {
            public void a(int paramInt, String paramString, b.a parama) {
                if ((parama != null) && (parama.a())) {
                    a.a(true);
                    a.a(parama.e());
                    if ("pic".equals(a.g())) {
                        a(parama.c(), a.h());
                        a.b(parama.d());
                        a.c(parama.b());
                    }
                    else {
                        if (!("news".equals(a.g())))
                            return;
                        a(parama.c(), a.i());
                        a.c(parama.b());
                        a.a(parama.f());
                    }
                }
                else {
                    a.a(false);
                }
            }

            public void a(String paramString1, String paramString2) {
                if (TextUtils.isEmpty(paramString1))
                    return;
                com.qihoo.gamecenter.sdk.support.g.a.a("SupportConfig", new Object[] { "quit window picture Path: ",
                        paramString2 });
                new com.qihoo.gamecenter.sdk.support.f.a(this.a).execute(new String[] { paramString1, paramString2 });
            }
        }).execute(new String[] { paramString, "" + paramBoolean });
    }

    public static boolean a() {
        return a;
    }

    public static String b() {
        return b;
    }

    public static String c() {
        return c;
    }

    public static String d() {
        return d;
    }

    public static b.b[] e() {
        return f;
    }

    public static String f() {
        return g;
    }

    public static boolean a(Context paramContext) {
        return m.b(paramContext, "has_show_message", true);
    }

    public static int b(Context paramContext) {
        int i = m.b(paramContext, "message_min_interval");
        return ((i == 0) ? 600000 : i);
    }

    public static int c(Context paramContext) {
        int i = m.b(paramContext, "message_max_interval");
        return ((i == 0) ? 900000 : i);
    }

    public static boolean d(Context paramContext) {
        return m.b(paramContext, "has_show_memory_clear", true);
    }

    public static boolean e(Context paramContext) {
        return m.b(paramContext, "has_show_service", true);
    }

    public static String f(Context paramContext) {
        return m.a(paramContext, "bbs_url");
    }
}